﻿using System;


namespace Sencha.Serialization.Exceptions
{
    [Serializable]
    class NoConstructorDefined : DataContractException
    {
        public NoConstructorDefined(Type anticipant, Type type)
            : base(Loc.GetErrorString("Exception_TypeContractViolation", anticipant.Name, type.Name, Loc.GetErrorString("Exception_NoParameterlessDefined", type.Name)), ErrorCode.TypeContractViolation)
        {
            if (type == null)
                throw new ArgumentNullException("type");
            if (anticipant == null)
                throw new ArgumentNullException("anticipant");
            System.Diagnostics.Contracts.Contract.EndContractBlock();
        }

        protected NoConstructorDefined(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
            : base(info, context)
        {
        }
    }
}
